package com.bright.cwduijie.duijie.constant;

import com.bright.cwduijie.common.util.StringUtil;
import com.bright.cwduijie.duijie.util.EntityManagerUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;

/**
 * @Author hxj
 * @Date 2024/7/14 09:45
 * @Description 系统常量
 */

@Component
public class SystemConstants {

    /**
     * 接口总批次数
     */
    public static final int TOTAL_BATCH_COUNT;

    /**
     * 批次顺序 key=当前批次 value=下一批次
     */
    public static final Map<String, String> NEXT_BATCH_MAP = new LinkedHashMap<>();
    /**
     * 按批次推送月份数据
     */
    public static final Map<String, String> MONTHLY_NEXT_BATCH_MAP = new LinkedHashMap<>();

    /**
     * 异步任务查询的最大等待天数 超过就算超时
     */
    public static final int WAIT_DUE_MAX_DAYS = 31;

    static {
        NEXT_BATCH_MAP.put("km", "pz");
        NEXT_BATCH_MAP.put("pz", "dcf");
        NEXT_BATCH_MAP.put("dcf", "bdc");
        NEXT_BATCH_MAP.put("bdc", "yj");
        NEXT_BATCH_MAP.put("yj", null);

        TOTAL_BATCH_COUNT = NEXT_BATCH_MAP.size();

        // v1.6.7 拟增加逐月按批次推送功能 先推月份数据 再推月结 再推下个月
        // 注意这些名称不要太长 否则batchId超长
        MONTHLY_NEXT_BATCH_MAP.put("yj1", "yfsj");
        MONTHLY_NEXT_BATCH_MAP.put("yfsj", "yj");
        MONTHLY_NEXT_BATCH_MAP.put("yj", null);

    }

}
